Skip to content

fix(installer): fix Windows installer bugs found during live testing#144

Merged
stephenleo merged 1 commit intomainfrom
fix-windows-installer
Mar 28, 2026
Merged

fix(installer): fix Windows installer bugs found during live testing#144
stephenleo merged 1 commit intomainfrom
fix-windows-installer

Conversation

@stephenleo
Copy link
Copy Markdown
Owner

Summary

  • Encoding crash: em dashes in install.ps1 were being misread by PowerShell 5.1 (UTF-8 bytes → Windows-1252 curly quotes → broken string parsing → elseif unrecognized). Replaced with ASCII hyphens.
  • Wrong install location: changed from %LOCALAPPDATA%\Programs\cship\ to ~/.local/bin so the binary is on Git Bash PATH immediately without a session restart. Directory is auto-created if missing; added to user PATH silently if not already present.
  • Wrong settings.json path: was %APPDATA%\Claude\settings.json (Roaming); correct path is ~/.claude/settings.json on all platforms including Windows. Fixed in install.ps1, uninstall.rs, README.md, and docs/index.md.
  • Wrong statusLine format: was "statusline": "cship" (wrong key, wrong value type); correct format is "statusLine": {"type": "command", "command": "cship"}. Fixed in install.ps1, uninstall.rs (key lookup + messages + tests), install.sh manual hint, and all explain.rs remediation hints.
  • Full path in messages: installer and uninstaller now print the full path of settings.json when updated.
  • Removed dead code: Windows-specific APPDATA branch in uninstall.rs and its test deleted; all platforms now use home.join(".claude/settings.json").

Test plan

  • Run .\install.ps1 on a clean Windows machine — binary lands in ~/.local/bin, ~/.local/bin added to PATH, ~/.claude/settings.json written with correct statusLine object
  • Verify which cship finds the binary in a new Git Bash session
  • Verify Claude Code picks up the statusline after restart
  • Run cship uninstall — confirms correct settings.json path in output, removes statusLine key
  • Run cargo test — all tests pass

🤖 Generated with Claude Code

- Replace em dashes with ASCII hyphens to prevent PowerShell 5.1
  encoding bug (UTF-8 bytes misread as Windows-1252 curly quotes,
  breaking elseif syntax)
- Change install location from %LOCALAPPDATA%\Programs\cship\ to
  ~/.local/bin so the binary is on Git Bash PATH without session restart
- Fix settings.json path: was %APPDATA%\Claude\settings.json, correct
  path is ~/.claude/settings.json on all platforms including Windows
- Fix statusLine format: was "statusline":"cship", correct format is
  "statusLine":{"type":"command","command":"cship"}
- Auto-create ~/.local/bin and silently add to user PATH if missing
- Show full settings.json path in all installer/uninstaller messages
- Remove Windows-specific APPDATA branch from uninstall.rs (now uses
  same home-relative path as all other platforms)
- Update README, docs, explain.rs hints, and install.sh manual hint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude bot commented Mar 28, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@stephenleo stephenleo merged commit d7385e3 into main Mar 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant